package com.test.app
import com.app.model.TUser
import com.app.service.user.IUserService
import com.test.BaseJerseyServiceTest
import groovy.transform.CompileStatic
import groovy.transform.TypeChecked
import org.glassfish.jersey.server.ResourceConfig
import org.junit.Test
import org.springframework.beans.factory.annotation.Autowired

import javax.ws.rs.core.Application

@CompileStatic
@TypeChecked
class UserServiceTest extends BaseJerseyServiceTest {

    @Override
    protected Application configure(ResourceConfig rc) {
        return rc;
    }

    @Autowired
    private IUserService userService;

    @Test
    public void testAdd() {
        TUser u = new TUser();
        u.setName("1");
        u.setPwd("1");
        try {
            userService.addBasic(u);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
